package com.netease.imageex.a;

import android.content.Context;
import android.graphics.PointF;
import android.os.Handler;
import android.util.FloatMath;
import android.view.MotionEvent;
import com.netease.imageex.ImageViewTouch;

public class c
{
  private static final int a = 0;
  private static final int b = 1;
  private static final int c = 2;
  private int d = 0;
  private PointF e = new PointF();
  private PointF f = new PointF();
  private float g = 1.0F;
  private float h = 0.0F;
  private ImageViewTouch i;
  private Handler j;
  private b k;

  public c(Context paramContext, ImageViewTouch paramImageViewTouch)
  {
    this.i = paramImageViewTouch;
    this.j = new Handler();
  }

  private void a(PointF paramPointF, a parama)
  {
    float f1 = parama.a(0) + parama.a(1);
    float f2 = parama.b(0) + parama.b(1);
    paramPointF.set(f1 / 2.0F, f2 / 2.0F);
  }

  private void a(a parama)
  {
    this.e.set(parama.c(), parama.d());
    this.d = 1;
    this.h = 0.0F;
  }

  private void b(a parama)
  {
    this.g = d(parama);
    if (this.g > 10.0F)
    {
      a(this.f, parama);
      this.d = 2;
    }
  }

  private void c(a parama)
  {
    if (this.d == 1)
    {
      this.i.a_(parama.c() - this.e.x, parama.d() - this.e.y);
      this.e.set(parama.c(), parama.d());
    }
    while (true)
    {
      return;
      if (this.d == 2)
      {
        float f1 = d(parama);
        if (f1 > 10.0F)
        {
          float f2 = f1 / this.g;
          this.h = f2;
          this.j.post(new e(this, f2));
        }
        this.g = f1;
        continue;
      }
    }
  }

  private float d(a parama)
  {
    float f1 = parama.a(0) - parama.a(1);
    float f2 = parama.b(0) - parama.b(1);
    return FloatMath.sqrt(f1 * f1 + f2 * f2);
  }

  public void a()
  {
    this.i = null;
    this.j = null;
  }

  public void a(b paramb)
  {
    this.k = paramb;
  }

  public boolean a(MotionEvent paramMotionEvent)
  {
    a locala = a.a(paramMotionEvent);
    int m = locala.b();
    com.netease.g.b.c("onMultiTouchEvent", "onMultiTouchEvent: " + m);
    if (m == 0)
      a(locala);
    while (true)
    {
      return true;
      if (m == a.c)
      {
        b(locala);
        continue;
      }
      if ((m == 1) || (m == a.b) || (m == 3))
      {
        this.d = 0;
        continue;
      }
      if (m != 2)
        continue;
      c(locala);
    }
  }
}

/* Location:           D:\android\hack\dex2jar-0.0.9.8\classes_dex2jar.jar
 * Qualified Name:     com.netease.imageex.a.c
 * JD-Core Version:    0.6.0
 */